
public class Task implements Priority,Complexity{
	int complexity;
	int priority;
	int ID;
	String TaskName;
	public Task()
	{}

	public void setPriority(int s) 
	{
		
			priority=s;
	}

	public int getPriority() 
	{
		return priority;
	}
	public Task(int a, String b,int _complexity,int _priority)
	{
		ID=a;
		TaskName=b;
		setComplexity(_complexity);
		setPriority(_priority);
	}
	
	public void display()
	{
		System.out.println("ID cua ban la "+ID);
		System.out.println("TaskName cua ban la "+TaskName);
	
		hienthi_prio();
		hienthi_comp();
	}

	public void setComplexity(int s1) 
	{	
		complexity=s1;			
	}

	public int getComplexity() {

		return complexity;
	}

	public void toTask(Task s)
	{
		if(this.priority>s.priority)
		{
			System.out.println("Cong viec co muc do uu tien cao hon la:");
			display();
			
		}
		else if(this.priority==s.priority)
		{
			if(this.complexity>s.complexity)
			{
				System.out.println("Cong viec co muc do uu tien cao hon la:");
				display();	
			}
			else if(this.complexity==s.complexity)
			{
				System.out.println("2 cong viec co muc do uu tin giong nhau");
				display();
				s.display();
			}
			else
			{
				System.out.println("Cong viec co muc do uu tien cao hon la:");
				s.display();
			}
		}
		else
		{
			System.out.println("Cong viec co muc do uu tien cao hon la:");
			display();
		
		}
	}

	public void hienthi_comp() {

		System.out.print("Do phuc tap cua cong viec la:");
		if(complexity==1) System.out.println("MIN_COMPLEXITY");
		if(complexity==2) System.out.println("NORMAL_COMPLEXITY");
		if(complexity==3) System.out.println("MAX_COMPLEXITY");
		
	}
	@Override
	public void hienthi_prio() 
	{
		System.out.print("Do uu tien cua cong viec la:");
		if(priority==1)
		{ 
			System.out.println("MIN_PRIORITY");
		}
		if(priority==5){
			System.out.println("NORMAL_PRIORITY");
		}
		if(priority==10) 
		{
			System.out.println("MAX_PRIORITY");
		}
		
		
		
	}
	public static void main(String[] args)
	{
		Task x=new Task(1,"Dihoc",1,10);
		Task y=new Task(2,"Dichoi", 2,10);
		System.out.println("thong tin cua cong viec thu 1 la:");
		x.display();
		System.out.println("thong tin cua cong viec thu 2 la:");
		y.display();
		x.toTask(y);		
	}

}
